<?php
/*
plugin name: TTTY-Banner配置
plugin URI: 
description: Banner配置
author: Tianye
author URI: 
version: 1.0
*/


function register_left_ttty_banner_conf(){
    add_options_page("Banner配置", "Banner配置", 8, __FILE__, "ttty_banner_config");
}


//插件内容
function ttty_banner_config(){
    //echo '这里是TTTY-Swiper插件的页面内容，可以添加表单设置。';
    //echo esc_attr(get_option('ttty_banner_conf'));
    //return;

    if (!empty($_POST['ttty_banner_conf'])) {
        update_option('ttty_banner_conf', $_POST['ttty_banner_conf']);
        echo '<div id="message" class="updated" style="line-height:50px;">保存成功！</div><br/><br/>';
    }

    $html = '' .
    '<p>设置你的Banner</p>' .
        '<form action="" method="post" id="my_plugin_test_form">' .
        '<h3>' .
        '<label for="test_input">配置Banner图片地址，每行一个：</label><br/><br/>' .
        '<textarea id="ttty_banner_conf" name="ttty_banner_conf" style="width:80%;height:400px;">' . esc_attr(get_option('ttty_banner_conf')) . '</textarea>' .
        '<h3>' .
        '<p>' .
        '<input type="submit" name="submit" value="保存" style="width:100px;height:30px;background:#ffffff;" />' .
        '</p>' .
    '</form>';
    echo $html;
}



//在adminmenu勾子中添加动作 register_left_ttty_banner_conf
if(is_admin()){
    add_action("admin_menu", "register_left_ttty_banner_conf");
}

?>